package com.bingxue.edu.management.education.model.query;


import com.bingxue.edu.common.enums.TermEnum;
import com.bingxue.edu.framework.mybatis.query.Query;
import com.bingxue.edu.framework.mybatis.query.QueryType;
import com.bingxue.edu.management.education.model.entity.ArrangeTemplate;
import com.mybatisflex.annotation.TableRef;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDate;

@Data
@TableRef(ArrangeTemplate.class)
@Schema(description = "排课模板查询条件")
public class ArrangeTemplateQuery {

    @Schema(description = "名称")
    @Query(type = QueryType.LIKE,field = "name")
    @Query(type = QueryType.LIKE,field = "fullName")
    private String keyword;

    @Schema(description = "上课年份")
    @NotNull(message="上课年份不能为空")
    private Integer classYear;

    @Schema(description = "学期")
    @NotNull(message="学期不能为空")
    private TermEnum term;

    @Schema(description = "年级")
    @NotNull(message="年级不能为空")
    private String grade;

    @Schema(description = "开始时间")
    @Query(type = QueryType.GE,field = "startDate")
    private LocalDate startDate;

    @Schema(description = "结束时间")
    @Query(type = QueryType.LT,field = "endDate")
    private LocalDate endDate;
}
